<div class="layui-card-body" id="alert_form">
    <form class="layui-form" action="" lay-filter="alert">
        <div class="layui-form-item">
            <label class="layui-form-label">权限名称</label>
            <div class="layui-input-block">
                <input type="text" name="power_name" value="" lay-verify="required" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">父级菜单</label>
            <div class="layui-input-block">
                <select name="parent_id" lay-verify="required" lay-search="">
                    <option value="">直接选择或搜索选择</option>
                    <option value="0">顶级菜单</option>
                    {volist name="menu" id="vo"}
                        {if condition="$vo.level eq 1"}
                            <option value="{$vo.id}">丨---{$vo.power_name}</option>
                        {else /}
                            <option value="{$vo.id}"> 丨---丨---{$vo.power_name}</option>
                        {/if}
                    {/volist}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">uri地址</label>
            <div class="layui-input-block">
                <input type="text" name="uri" value="" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"><a href="https://www.layui.com/doc/element/icon.html" style="color: #1E9FFF;" target="_blank">图标</a></label>
            <div class="layui-input-block">
                <input type="text" name="icon" value="" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="text" name="sort" value="" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">单选框</label>
            <div class="layui-input-block">
                <input type="radio" name="type" value="0" title="菜单" checked="">
                <input type="radio" name="type" value="1" title="按钮">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="save">保存</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<script>
    //监听提交
    form.on('submit(save)', function (obj) {
        var post = obj.field;
        submitPost('{:url("admin/power/add")}', post);
        return false;
    });
</script>
